import { EDITOR_ELEMENT_TYPE, PLUGINS_KEYS, Plugin } from '../types';

function Bold(): Plugin {
  return {
    key: PLUGINS_KEYS.BOLD,
    type: EDITOR_ELEMENT_TYPE.INLINE,
    matchLeaf: (props) => !!props.leaf[PLUGINS_KEYS.BOLD],
    renderLeaf: (context) => {
      return <strong>{context.children}</strong>;
    },
  };
}

export default Bold;
